#include <bits/stdc++.h>
using namespace std;

#define NAME "duel"
const int N = 1e5+5, mod = 998244353;

using LL = long long;
//#define int long long

namespace PZA {
int qpow(int a, int b) {
    a %= mod;
    int cur = a, ret = 1;
    while (b) {
        if (b&1) ret = (LL)ret * cur % mod;
        b >>= 1;
        cur = (LL)cur * cur % mod; 
    }
    return ret;
}


int h[N], ne[2*N], W[2*N], E[2*N], NNN;
void add(int u, int v, int w) {
    E[NNN] = v, W[NNN] = w, ne[NNN] = h[u], h[u] = NNN++;
}


const int MaxF = 1e5+7;
int fact[MaxF], fact_inv[MaxF];
void initFact() {
    fact[0] = 1;
    for (int i = 1; i < MaxF; i++) {
        fact[i] = (LL)fact[i-1] * i % mod;
    }
    fact_inv[MaxF-1] = qpow(fact[MaxF-1], mod-2);
    for (int i = MaxF-2; i >= 0; i--) {
        fact_inv[i] = (LL)fact_inv[i+1] * (i+1) % mod;
    }
}

int C(int n, int m) {
    // int res = 1;
    // for (int i = n-m+1; i <= n; i++) {
    //     res = (LL)res*i%mod; 
    // }
    // int div = 1;
    // for (int i = 2; i <= m; i++) {
    //     div = (LL)div*i%mod;
    // }
    // return (LL)res * qpow(div, mod-2) % mod;
    
    return (LL)fact[n] * fact_inv[n-m] % mod * fact_inv[m] % mod;
}
}

using namespace PZA;

int a[N];

signed main() {
    freopen(NAME ".in", "r", stdin);
    freopen(NAME ".out", "w", stdout);

    //initFact();

    int n; scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);

    sort(a, a+n);

    int sum = 0, cnt = 0, cur = a[0], ans = n;

    for (int i = 0; i < n; i++) {
        if (a[i] > cur) {
            cnt += sum, sum = 1;
            cur = a[i];
        } else {
            sum++;
        }
        //cout << a[i] << " " << cnt << " " << sum << endl;
        if (cnt > 0) cnt--, ans--;
    }
    printf("%d\n", ans);

    return 0;
}